package de.stefanocke.roo.wicket.templates;

import org.springframework.roo.model.JavaType;

/**
 * Interface for a template that "passively" creates a Java class (and
 * optionally other artifacts belonging to this Java class).
 * 
 * @author stoc
 * 
 */
public interface IJavaTemplate {

	/**
	 * Initializes the Template.
	 * 
	 * @param templates
	 *            provides access to the other templates and to
	 *            {@link TemplateSupportService}.
	 */
	void init(Templates templates);

	void createFiles(boolean forceUpdate);

	/**
	 * 
	 * @return the JavaType generated by the template.
	 */
	JavaType getJavaType();

	/**
	 * 
	 * @return true, if the Java class to be generated already existed when the
	 *         template has been initialized
	 */
	boolean exists();

	/**
	 * 
	 * @return the name of the subpackage (below "web" or "domain" package) to
	 *         use when the Java class does not yet exist and is freshly created
	 */
	String subPackageToUseWhenNew();

	/**
	 * 
	 * @return true means, that this template creates some artifact to be placed
	 *         in the "domain" package. False means "web" package.
	 */

	boolean isDomain();

}
